package com.ocom.webapi.feign;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.constant.RecodeUrl;
import com.ocom.common.constant.UnifiendPayUrl;
import com.ocom.common.request.payconfig.mealorder.GetOrderDishesRequest;
import com.ocom.common.request.web.AccDiscountReportsOnShowRequest;
import com.ocom.common.request.web.CashDailyRequest;
import com.ocom.common.request.web.GetConsPerReportsRequest;
import com.ocom.common.request.xfrecde.*;
import com.ocom.common.resp.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "xfrecode")
public interface XfRecordFeign {

    @PostMapping(UnifiendPayUrl.URL_getConsumeDetail)
    Result getConsumeDetail(@RequestBody JSONObject jsonObject);

    @PostMapping(UnifiendPayUrl.URL_getConsumeReports)
    Result getConsumeReports(@RequestBody JSONObject jsonObject);

    @PostMapping(UnifiendPayUrl.URL_getConsumeReportsC)
    Result getConsumeReportsC(@RequestBody JSONObject jsonObject);

    //钱包余额
    @PostMapping(UnifiendPayUrl.URL_walletBalance)
    public Result walletBalance(@RequestParam("comId")Long comId,@RequestParam("month") String month,@RequestParam("subAccount") Integer subAccount);

    //补贴钱包日报
    @PostMapping(UnifiendPayUrl.URL_subsidyDaily)
    public Result subsidyDaily(@RequestParam("comId")Long comId,@RequestParam("endDate")String endDate,@RequestParam("subAccount") Integer subAccount);

    //现金钱包日报表
    @PostMapping(UnifiendPayUrl.URL_rechargeDaily)
    public Result rechargeDaily(@RequestParam("comId")Long comId,@RequestParam("endDate")String endDate,@RequestParam("subAccount") Integer subAccount);

    //现金月报
    @PostMapping(UnifiendPayUrl.URL_cashMonthly)
    public Result cashMonthly(@RequestParam("comId") Long comId,@RequestParam("endDate") String endDate,
                              @RequestParam("subAccount") Integer subAccount,
                              @RequestParam("merchIds") String merchIds
                              );

    //现金日报
    @PostMapping(UnifiendPayUrl.URL_cashDaily)
    public Result cashDaily(@RequestBody CashDailyRequest cashDailyRequest);

    @PostMapping(UnifiendPayUrl.URL_merchMonthly)
    public Result merchMonthly(@RequestParam("comId") Long comId,@RequestParam("endDate") String endDate,
                               @RequestParam("subAccount") Integer subAccount,
                               @RequestParam("merchIds") String merchIds
    );

    //商户消费日报
    @PostMapping(UnifiendPayUrl.URL_merchDaily)
    public Result merchDaily(@RequestParam("comId") Long comId,@RequestParam("endDate") String endDate,@RequestParam("merchId")Integer merchId,@RequestParam("subAccount") Integer subAccount);

    //人员消费汇总报表
    @PostMapping(UnifiendPayUrl.URL_getConsPerReports)
    public Result getConsPerReports(@RequestBody GetConsPerReportsRequest getConsPerReportsRequest);

    @PostMapping(UnifiendPayUrl.URL_getAccDiscountReports)
    public Result getAccDiscountReports(@Validated @RequestBody AccDiscountReportsOnShowRequest request);


    @PostMapping(UnifiendPayUrl.URL_getConsRecNum)
    public Result getConsRecNum(@RequestParam("beginComId")Long beginComId, @RequestParam("endComId")Long endComId ,@RequestParam("month")String month);

    @PostMapping(UnifiendPayUrl.URL_getSubDbConsRecNum)
    public Result getSubDbConsRecNum(@RequestParam("beginComId")Long beginComId,@RequestParam("endComId") Long endComId ,@RequestParam("month")String month);

    @PostMapping(UnifiendPayUrl.URL_getConsMonthData)
    public Result getConsMonthData(@RequestParam("comId")Long comId,@RequestParam("beginMonth")String beginMonth,@RequestParam("endMonth") String endMonth );

    @PostMapping(UnifiendPayUrl.URL_getSubDbConsMonthData)
    public Result getSubDbConsMonthData(@RequestParam("beginComId")Long beginComId,@RequestParam("endComId") Long endComId ,@RequestParam("beginMonth")String beginMonth,@RequestParam("endMonth") String endMonth );


    @PostMapping(UnifiendPayUrl.URL_getChannelData)
    public Result getChannelData(@RequestParam("comId")Long comId,
                                 @RequestParam("payChannelNo")String payChannelNo,
                                 @RequestParam("startTime")String startTime ,
                                 @RequestParam("endTime")String endTime);

    @PostMapping(UnifiendPayUrl.URL_getXfGoodList)
    public Result getXfGoodList(@RequestBody GetXfGoodListRequest request);


    @PostMapping(UnifiendPayUrl.URL_getOrderDishesC)
    public Result getOrderDishesC(@RequestBody GetOrderDishesRequest request);

    @PostMapping(UnifiendPayUrl.URL_getMealPreReportsXM)
    public Result getMealPreReportsXM(@RequestBody GetMealPreReportsXMRequest reportsXMRequest);

    @PostMapping(UnifiendPayUrl.URL_getMealSendReportsXMByOne)
    public Result getMealSendReportsXMByOne (@RequestBody GetMealSendReportsXMByOneRequest reportsXMByOneRequest);

    @PostMapping(UnifiendPayUrl.URL_getMealSendReportsXMByTwo)
    public Result getMealSendReportsXMByTwo(@RequestBody GetMealSendReportsXMByTwoRequest reportsXMByTwoRequest);

    @PostMapping(RecodeUrl.getNotMealRecode)
    public Result getNotMealRecode(@RequestBody NotMealRecodeRequest request);


    /**
     * 天感2个报表
     * @param request
     * @return
     */
    @PostMapping(RecodeUrl.URL_getConsPerByMealTimes)
    public Result getConsPerByMealTimes(@RequestBody GetConsPerByMealTimesReq request);

    @PostMapping(RecodeUrl.URL_getConsDeptByMealTimes)
    public Result getConsDeptByMealTimes(@RequestBody GetConsDeptByMealTimesReq request);
}
